package com.spm.librarianmanagersystem.mapper;

import com.spm.librarianmanagersystem.pojo.Fine;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface FineMapper {
    Double getFineByBorrowNum(Integer borrowingId);

    Integer getFineStatusByBorrowNum(Integer borrowingId);

    List<Fine> getFineList(String currentUserId);

    List<Fine> getFineHistory(String currentUserId);

    Boolean deleteAllByUserID(Integer userID);

    @Select("SELECT * FROM fine")
    List<Fine> getAllFine();

    @Select("SELECT * FROM fine WHERE user_id = #{userID}")
    List<Fine> getFineByUserID(Integer userID);

    Double getTotalFineAmount(Integer userID);

    Integer getFineNum();

    Double getFineCollected();

    void updateFine0(Integer borrowingId);

    void addFine(Fine fine);
}
